package com.tencent50.easy;

import java.util.HashSet;
import java.util.Set;

/**
 * @author zhengTao
 * @version 1.0
 * @description: 存在重复元素
 * @date 2022/7/24 17:18
 */
public class Demo16 {
    public static void main(String[] args) {

    }
    public static boolean containsDuplicate(int[] nums) {

          Set<Integer> numSet=new HashSet<>();
          for (int num : nums) {
              numSet.add(num);
          }
          return numSet.size()!=nums.length;

    }
}
